#ifndef GRPCEVENTBASE_H
#define GRPCEVENTBASE_H

#include <string>
#include "nlohmann/json.hpp"

class GrpcEventJsonAvis
{
public:
    std::string SourceId ;

    std::string TargetId ;

    std::string EventName ;

    nlohmann::json Parameters;

    NLOHMANN_DEFINE_TYPE_INTRUSIVE(GrpcEventJsonAvis, SourceId, TargetId, EventName, Parameters)
};

//事件参数都按这个来继承
class EventParamNull {

public:
    virtual ~EventParamNull() = default;
    //将结构体序化为json 数组
    virtual nlohmann::json SerializeToJsonArray() { return nlohmann::json::array();}
    //从json 反序列化为结构体
    virtual bool ParseFromJsonArray(const nlohmann::json& ) { return true; }

};

#endif // GRPCEVENTBASE_H
